<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="include/head::head"></head>

<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <div th:replace="/include/sidebar"></div>

        <!-- top navigation -->
        <div th:replace="include/navigation::navigation"></div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main" style="min-height: 1136px;">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>用户资料</h3>
                    </div>

                </div>

                <div class="clearfix"></div>

                <div class="row">
                    <div class="col-md-12 col-sm-12 ">
                        <div class="x_panel">
                            <div class="x_content">
                                <div class="col-md-3 col-sm-3  profile_left">
                                    <div class="profile_img">
                                        <div id="crop-avatar">
                                            <!-- Current avatar -->
                                            <img style="width: 95%;" class="img-responsive avatar-view" src="images/img.jpg" alt="Avatar" title="Change the avatar">
                                        </div>
                                    </div>
                                    <h3><span th:text="${session.userName}"></span></h3>

                                    <ul class="list-unstyled user_data">

                                        <li>
                                            <i class="fa fa-briefcase user-profile-icon"></i> Software Engineer
                                        </li>

                                    </ul>


                                </div>
                                <div class="col-md-9 col-sm-9 ">


                                    <div class="" role="tabpanel" data-example-id="togglable-tabs">
                                        <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
                                            <li role="presentation" class=""><a href="#tab_content3" role="tab" id="profile-tab2" data-toggle="tab" aria-expanded="false" class="active">Profile</a>
                                            </li>
                                        </ul>
                                        <div id="myTabContent" class="tab-content">
                                            <form id="demo-form2"  class="form-horizontal form-label-left" th:action="@{/save-profile}" method="post">

                                                <div class="item form-group" id="divID">
                                                    <label class="col-form-label col-md-3 col-sm-3 label-align">
                                                    </label>
                                                    <div class="col-md-6 col-sm-6 ">
                                                        <input type="text" id="id" required="required" class="form-control" th:value="${user.userId}" name="id">
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="col-form-label col-md-3 col-sm-3 label-align">姓名
                                                    </label>
                                                    <div class="col-md-6 col-sm-6 ">
                                                        <input type="text" id="name" name="name" required="required" class="form-control" th:value="${user.userName}">
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="col-form-label col-md-3 col-sm-3 label-align" >邮箱
                                                    </label>
                                                    <div class="col-md-6 col-sm-6 ">
                                                        <input type="text" id="email" name="email" required="required" class="form-control" th:value="${user.userEmail}">
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="col-form-label col-md-3 col-sm-3 label-align">密码</label>
                                                    <div class="col-md-6 col-sm-6 ">
                                                        <input id="password" class="form-control" type="button" name="password" value="重置密码">
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="col-form-label col-md-3 col-sm-3 label-align">个人简介
                                                    </label>
                                                    <div class="col-md-6 col-sm-6 ">
                                                        <textarea class="form-control" name="profile" id="profile" th:text="${user.userProfile}"></textarea>
                                                    </div>
                                                </div>
                                                <div class="ln_solid"></div>
                                                <div class="item form-group">
                                                    <div class="col-md-6 col-sm-6 offset-md-3">
                                                        <button type="submit" class="btn btn-success">保存</button>
                                                    </div>
                                                </div>

                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /page content -->
        <!-- footer content -->
        <div th:replace="include/footer::footer"></div>
        <!-- /footer content -->
    </div>
</div>

<div th:replace="include/javascript::javascript"></div>

<script th:inline="javascript">
    $(function () {
        $("#divID").hide();
        $("#password").on("click",function () {
            $("#password").attr("type","text");
            $("#password").val("");
        })
    })
</script>
</body>
</html>
